{include file="../application/admin/view/admin/header.html" /}
		<div class="nav_z clearfix">
			<div id="box" class="nav_nav">
				<ul>
			       <li class="kebi trr tdd"><a href="{:url('admin/Index/index')}">教师工作量</a></li>
			       <li class="tdd"><a href="{:url('admin/Admin/index')}">领导统计表</a></li>
			    </ul>
				<ul class="gdd">
					<li class="rdd edd"><span class="glyphicon glyphicon-home"></span>首页</li>
					<li class="edd ti"><a href="{:url('admin/Admin/index')}"><span class="glyphicon glyphicon-list-alt"></span>学期管理</a></li>
					<li class="edd ti"><a href="{:url('admin/Admin/banji')}"><span class="glyphicon glyphicon-list-alt"></span>班级管理</a></li>
					<li class="edd ti"><a href="{:url('admin/Admin/kecheng')}"><span class="glyphicon glyphicon-list-alt"></span>课程管理</a></li>
					<li class="xuanz edd ti"><a id="add" href="{:url('admin/Admin/yohu')}"><span class="glyphicon glyphicon-list-alt"></span>用户管理</a></li>
					<li id="wei" class="edd ti toji"><a href="#"><span class="glyphicon glyphicon-list-alt"></span>教师统计表</a></li>
					<li class="jiao">
                        <ul>
					       <li><a href="{:url('admin/Admin/winning')}">获奖统计</a></li>
					       <li><a href="{:url('admin/Admin/training')}">实训统计</a></li>
					       <li><a href="{:url('admin/Admin/sk')}">授课统计</a></li>
					       <li><a href="{:url('admin/Admin/research')}">科研项目统计</a></li>
					       <li><a href="{:url('admin/Admin/paper')}">论文发表统计</a></li>
					       <li><a href="{:url('admin/Admin/train')}">培训(出差)统计</a></li>
					    </ul>
					</li>
					<li class="edd ti"><a href="{:url('admin/Admin/toji')}"><span class="glyphicon glyphicon-list-alt"></span>总体统计表</a></li>
				</ul>
			</div>
		</div>
		<!-- 领导表格 -->
		<div class="nav_z_cont">
			<!-- 用户管理表格 -->
			<div class="yi">
				    <form action="{:url('admin/Admin/u_search')}" class="xzxueqi">
				    	<div class="fu_h">
							<input type="text" name="search" class="btn" placeholder="请输入用户名查询">
							<button type="submit" class="btn"><span class="glyphicon glyphicon-search"></span></button>
					    </div>
					</form>
					<table>
						<tr class="tr1">
							<td colspan="2" style="text-align: left;">用户管理</td>
							<td colspan="2" style="text-align: right;">
								<button id="xinz"><span class="glyphicon glyphicon-plus"></span>新增</button>
							</td>
						</tr>
						<tr>
							<td>用户名</td>
							<td>职务</td>
							<td>邮箱</td>
							<td>操作</td>
						</tr>
						{volist name="userList" id="vo" empty="$empty"}
							<tr>
								<td>{$vo['username']}</td>
								<td>{if $vo['admin']==1}领导{else /}教师{/if}</td>
								<td>{$vo['email']}</td>
								<td class="caoz">
								<button type="button" class="btn bianji bianj" onclick="yh_v({$vo['id']})">编辑</button>
								<button type="button" class="btn shanchu" onclick='if(confirm("确定重置为默认密码？")){window.location="{:url('admin/Admin/yh_reset',['id'=> $vo['id']])}"}'>重置</button>
								<button type="button" class="btn shanchu" onclick='if(confirm("确定删除？")){window.location="{:url('admin/Admin/yh_del',['id'=> $vo['id']])}"}'>删除</button>
							</td>
							</tr>
						{/volist}
					</table>
					<div class="page">
						{$page}
					</div>
			</div>
		</div>
		<!-- 新增窗口 -->
		<div class="box">
		　	<span class="closeBtn glyphicon glyphicon-remove" title="关闭"></span>
			<h2><span class="glyphicon glyphicon-tag"></span>新增用户</h2>
			<form action="{:url('admin/Admin/yh_add')}" method="post">
				<p>用户名:<input type="text" name="username" placeholder="请输入名称"></p>
				<p>职务:<select name="admin" id="">
						<option value="1">领导</option>
						<option value="0">教师</option>
					</select>
				</p>
				<p>邮箱:<input type="text" name="email" placeholder="请输入邮箱"></p>
				<p><button type="submit">保存</button><button type="reset">重置</button></p>
			</form>
		</div>
		<!-- 编辑窗口 -->
		<div class="bjbox">
		　	<span class="closeBtn glyphicon glyphicon-remove" title="关闭"></span>
			<h2><span class="glyphicon glyphicon-tag"></span>编辑用户</h2>
			<form action="{:url('admin/Admin/yh_edit')}" method="post">
				<input type="hidden" name="id" id="id">
				<p>用户名:<input type="text" name="username" id="username"></p>
					<p>职务:<select name="admin" id="admin">
							<option value="1">领导</option>
							<option value="0">教师</option>
						</select>
					</p>
				<p>邮箱:<input type="text" name="email" id="email"></p>
				<p><button type="submit">保存</button><button type="reset">重置</button></p>
			</form>
		</div>

	</div>
</body>
<script>
//用户数据传到编辑框
	function yh_v(id){
		var url = "{:url('admin/Admin/yh_v')}";
		$.get(url,{id:id},
			function(data){
				$('#id').val(data.id);
				$('#username').val(data.username);
				$('select#admin').val(data.admin);
				$('#email').val(data.email);
			}
		);
	}
</script>
</html>